package com.bingo.demo.controller;

import com.bingo.demo.DAO.UserMapper;
import com.bingo.demo.pojo.Essay;
import com.bingo.demo.pojo.User;
import com.bingo.demo.service.EssayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.ClassUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class Mycontroller {

    @Autowired
    UserMapper userMapper;

    @Autowired
    EssayService essayService;
    @RequestMapping("test")
    @ResponseBody
    public String testMybatis(HttpServletRequest request){
        List<Essay> list1 = essayService.findAll();
        System.out.println(list1.get(0).getId());
        List<Essay> list2 = essayService.findAll();
        System.out.println(list2.get(0).getId());
        return list1.toString();
    }
}
